﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link type="text/css" rel="stylesheet" media="all" href="../styles/global.css"/>
    <link type="text/css" rel="stylesheet" media="all" href="../styles/global_color.css"/>
    <script src="../../js/jquery-3.2.1.js"></script>
    <script language="javascript" type="text/javascript">
        //排序按钮的点击事件
        function sort(btnObj) {
            if (btnObj.className == "sort_desc")
                btnObj.className = "sort_asc";
            else
                btnObj.className = "sort_desc";
        }

        //启用
        function startFee() {
            var r = window.confirm("确定要启用此资费吗？资费启用后将不能修改和删除。");
            document.getElementById("operate_result_info").style.display = "block";
        }
        //删除
        function deleteFee(id) {
            var r = window.confirm("确定要删除此角色吗？");
            if (r) {
                $.ajax({
                    url: "/deletecost",
                    type: "post",
                    data: {
                        costid: id
                    },
                    success: function () {
                        document.getElementById("operate_result_info").style.display = "block";
                        window.location.href = "/feelist";
                    }
                });
            }
        }
    </script>
</head>
<body>
<!--Logo区域开始-->
<div id="header">
    <img src="../images/logo.png" alt="logo" class="left"/>
    <a href="/logout">[退出]</a>
</div>
<!--Logo区域结束-->
<!--导航区域开始-->
<div id="navi">
    <ul id="menu">
        <li><a href="/index" class="index_on"></a></li>
        <li><a href="/rolelist" class="role_off"></a></li>
        <li><a href="/adminList" class="admin_off"></a></li>
        <li><a href="/feelist" class="fee_off"></a></li>
        <li><a href="/accountlist" class="account_off"></a></li>
        <li><a href="/servicelist" class="service_off"></a></li>
        <li><a href="/billList" class="bill_off"></a></li>
        <li><a href="/reportList" class="report_off"></a></li>
        <li><a href="/userInfo" class="information_off"></a></li>
        <li><a href="/userModiPwd" class="password_off"></a></li>
    </ul>
</div>
<!--导航区域结束-->
<!--主要区域开始-->
<div id="main">
    <form action="" method="">
        <!--排序-->
        <div class="search_add">
            <div>
                <!--<input type="button" value="月租" class="sort_asc" onclick="sort(this);" />-->
                <input type="button" value="基费" class="sort_asc" onclick="sortbace(this);"/>
                <input type="button" value="时长" class="sort_asc" onclick="sorttime(this);"/>
            </div>
            <input type="button" value="增加" class="btn_add" onclick="window.location.href='/feeAdd';"/>
        </div>
        <!--启用操作的操作提示-->
        <div id="operate_result_info" class="operate_success">
            <img src="../images/close.png" onclick="this.parentNode.style.display='none';"/>
            删除成功！
        </div>
        <!--数据区域：用表格展示数据-->
        <div id="data">
            <table id="datalist">
                <tr>
                    <th>资费ID</th>
                    <th class="width100">资费名称</th>
                    <th>基本时长</th>
                    <th>基本费用</th>
                    <th>单位费用</th>
                    <th>创建时间</th>
                    <th>开通时间</th>
                    <th class="width50">状态</th>
                    <th class="width200"></th>
                </tr>
            </table>
            <p>业务说明：<br/>
                1、创建资费时，状态为暂停，记载创建时间；<br/>
                2、暂停状态下，可修改，可删除；<br/>
                3、开通后，记载开通时间，且开通后不能修改、不能再停用、也不能删除；<br/>
                4、业务账号修改资费时，在下月底统一触发，修改其关联的资费ID（此触发动作由程序处理）
            </p>
        </div>
        <!--分页-->
        <div id="pages">
        </div>
    </form>
</div>
<!--主要区域结束-->
<script src="../../js/jquery-3.2.1.js"></script>
<script>
    //开通或暂停
    function setState(result) {
        var indexof = result.indexOf(",");
        var status = result.substr(-1, 1);
        var costId = result.substr(0, indexof);
        if (status == 0) {
            if (window.confirm("确定要暂停此账务账号吗？")) {
                $.ajax({
                    url: "/updateStatusByCostId",
                    type: "post",
                    data: {
                        status: 1,
                        costId: costId
                    },
                    success: function () {
                        window.location.href = "/feelist";
                        //document.getElementById("operate_result_info").style.display = "block";
                    }
                });
            }
        }
        if (status == 1) {
            if (window.confirm("确定要开通此账务账号吗？")) {
                $.ajax({
                    url: "/updateStatusByCostId",
                    type: "post",
                    data: {
                        status: 0,
                        costId: costId
                    },
                    success: function () {
                        window.location.href = "/feelist";
                        //document.getElementById("operate_result_info").style.display = "block";
                    }
                });
            }
        }
    }
    var ip = 1;
    $.ajax({
        url: "/listfee",
        data: {
            pagenum: ip
        },
        type: "post",
        success: function (data) {
            console.log(data);
            for (var i in data.list) {
                var cost = data.list[i];
                var create = cost.creatime;
                var open = cost.startime;
                var createdate = getLocalTime(create);
                var startdate = getLocalTime(open);
                var status = cost.status;
                var ss = cost.status;
                var costId = cost.costId;
                var s = null;
                if (status == 0) {
                    status = "开通";
                    s = "暂停";
                    $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_pause' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                }
                if (status == 1) {
                    status = "暂停";
                    s = "启用";
                    $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_start' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                }
                if (status == 2) {
                    status = "删除";
                    s = " ";
                    $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' onclick=\"setState('" + costId + "," + ss + "')\"/></td></tr>"));
                }

            }

            //            当前页码
            var pageNum = data.pageNum;
//            每页的数量
            var pageSize = data.pageSize;
//            当前页的数量
            var size = data.size;
//            数据总数
            var total = data.total;
//            一共多少页
            var pages = data.pages;
//            首页是多少
            var firstPage = data.firstPage;
//            上一页是多少
            var prePage = data.prePage;
//            下一页是多少
            var nextPage = data.nextPage;
//            最后一页是多少
            var lastPage = data.lastPage;
//            是否是首页
            var isFirstPage = data.isFirstPage;
//            是否是尾页
            var isLastPage = data.isLastPage;
            if (isFirstPage) {
                prePage = prePage + 1;
            }
            if (isLastPage) {
                nextPage = lastPage;
            }
            $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + prePage + ")'>" + "<<<" + "</a>"));
            for (i = 1; i <= lastPage; i++) {
                $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + i + ")'>" + i + "</a>"))
            }
            $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + nextPage + ")'>" + ">>>" + "</a>"));
            var urlstatus = false;
            if (!urlstatus) {
                $("#pages a").eq(1).addClass('current_page');
            }
        }
    });
    function page(i) {
        ip = i;
        $.ajax({
            url: "/listfee",
            data: {
                pagenum: ip
            },
            type: "post",
            success: function (data) {
                console.log(data);
                $("#datalist").html("");
                $("#datalist").append("<tr><th>资费ID</th><th class='width100'>资费名称</th><th>基本时长</th><th>基本费用</th><th>单位费用</th><th>创建时间</th><th>开通时间</th><th class='width50'>状态</th><th class='width200'></th></tr>");
                for (var i in data.list) {
                    var cost = data.list[i];
                    var create = cost.creatime;
                    var open = cost.startime;
                    var createdate = getLocalTime(create);
                    var startdate = getLocalTime(open);
                    var status = cost.status;
                    var ss = cost.status;
                    var costId = cost.costId;
                    var s = null;
                    if (status == 0) {
                        status = "开通";
                        s = "暂停";
                        $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_pause' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                    }
                    if (status == 1) {
                        status = "暂停";
                        s = "启用";
                        $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_start' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                    }
                    if (status == 2) {
                        status = "删除";
                        s = " ";
                        $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' onclick=\"setState('" + costId + "," + ss + "')\"/></td></tr>"));
                    }

                }

                //            当前页码
                var pageNum = data.pageNum;
//            每页的数量
                var pageSize = data.pageSize;
//            当前页的数量
                var size = data.size;
//            数据总数
                var total = data.total;
//            一共多少页
                var pages = data.pages;
//            首页是多少
                var firstPage = data.firstPage;
//            上一页是多少
                var prePage = data.prePage;
//            下一页是多少
                var nextPage = data.nextPage;
//            最后一页是多少
                var lastPage = data.lastPage;
//            是否是首页
                var isFirstPage = data.isFirstPage;
//            是否是尾页
                var isLastPage = data.isLastPage;
                if (isFirstPage) {
                    prePage = prePage + 1;
                }
                if (isLastPage) {
                    nextPage = lastPage;
                }
                $("#pages").html("");
                $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + prePage + ")'>" + "<<<" + "</a>"));
                for (i = 1; i <= lastPage; i++) {
                    $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + i + ")'>" + i + "</a>"))
                }
                $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + nextPage + ")'>" + ">>>" + "</a>"));
                $("#pages a").siblings('a').removeClass('selected');
                $("#pages a").eq(pageNum).addClass('current_page');
            }
        });
    }
    function getLocalTime(jsondate) {
        jsondate = "" + jsondate + "";
        if (jsondate.indexOf("+") > 0) {
            jsondate = jsondate.substring(0, jsondate.indexOf("+"));
        }
        else if (jsondate.indexOf("-") > 0) {
            jsondate = jsondate.substring(0, jsondate.indexOf("-"));
        }
        var date = new Date(parseInt(jsondate, 10));
        var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
        var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
        var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
        var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
        var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
        return date.getFullYear() + "-" + month + "-" + currentDate + " " + hours + ":" + minutes + ":" + seconds;
    }
    function updateFee(costId) {
        window.location.href = '/costupdate?costid=' + costId + '';
    }
    /*    //排序按钮的点击事件
     function sort(btnObj) {
     if (btnObj.className == "sort_desc")
     btnObj.className = "sort_asc";
     else
     btnObj.className = "sort_desc";
     }*/
    //排序按钮的点击事件
    function sortbace(btnObj) {
        if (btnObj.className == "sort_desc") {
            btnObj.className = "sort_asc";
            var ip = 1;
            $.ajax({
                url: "/costbaseAsc",
                data: {
                    pagenum: ip
                },
                type: "post",
                success: function (data) {
                    console.log(data);
                    $("#datalist").html("");
                    $("#datalist").append("<tr><th>资费ID</th><th class='width100'>资费名称</th><th>基本时长</th><th>基本费用</th><th>单位费用</th><th>创建时间</th><th>开通时间</th><th class='width50'>状态</th><th class='width200'></th></tr>");
                    for (var i in data.list) {
                        var cost = data.list[i];
                        var create = cost.creatime;
                        var open = cost.startime;
                        var createdate = getLocalTime(create);
                        var startdate = getLocalTime(open);
                        var status = cost.status;
                        var ss = cost.status;
                        var costId = cost.costId;
                        var s = null;
                        if (status == 0) {
                            status = "开通";
                            s = "暂停";
                            $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_pause' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                        }
                        if (status == 1) {
                            status = "暂停";
                            s = "启用";
                            $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_start' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                        }
                        if (status == 2) {
                            status = "删除";
                            s = " ";
                            $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' onclick=\"setState('" + costId + "," + ss + "')\"/></td></tr>"));
                        }
                    }

                    //            当前页码
                    var pageNum = data.pageNum;
//            每页的数量
                    var pageSize = data.pageSize;
//            当前页的数量
                    var size = data.size;
//            数据总数
                    var total = data.total;
//            一共多少页
                    var pages = data.pages;
//            首页是多少
                    var firstPage = data.firstPage;
//            上一页是多少
                    var prePage = data.prePage;
//            下一页是多少
                    var nextPage = data.nextPage;
//            最后一页是多少
                    var lastPage = data.lastPage;
//            是否是首页
                    var isFirstPage = data.isFirstPage;
//            是否是尾页
                    var isLastPage = data.isLastPage;
                    if (isFirstPage) {
                        prePage = prePage + 1;
                    }
                    if (isLastPage) {
                        nextPage = lastPage;
                    }
                    $("#pages").html("");
                    $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + prePage + ")'>" + "<<<" + "</a>"));
                    for (i = 1; i <= lastPage; i++) {
                        $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + i + ")'>" + i + "</a>"))
                    }
                    $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + nextPage + ")'>" + ">>>" + "</a>"));
                    var urlstatus = false;
                    if (!urlstatus) {
                        $("#pages a").eq(1).addClass('current_page');
                    }
                }
            });
            function page(i) {
                ip = i;
                $.ajax({
                    url: "/costbaseAsc",
                    data: {
                        pagenum: ip
                    },
                    type: "post",
                    success: function (data) {
                        console.log(data);
                        $("#datalist").html("");
                        $("#datalist").append("<tr><th>资费ID</th><th class='width100'>资费名称</th><th>基本时长</th><th>基本费用</th><th>单位费用</th><th>创建时间</th><th>开通时间</th><th class='width50'>状态</th><th class='width200'></th></tr>");
                        for (var i in data.list) {
                            var cost = data.list[i];
                            var create = cost.creatime;
                            var open = cost.startime;
                            var createdate = getLocalTime(create);
                            var startdate = getLocalTime(open);
                            var status = cost.status;
                            var ss = cost.status;
                            var costId = cost.costId;
                            var s = null;
                            if (status == 0) {
                                status = "开通";
                                s = "暂停";
                                $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_pause' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                            }
                            if (status == 1) {
                                status = "暂停";
                                s = "启用";
                                $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_start' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                            }
                            if (status == 2) {
                                status = "删除";
                                s = " ";
                                $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' onclick=\"setState('" + costId + "," + ss + "')\"/></td></tr>"));
                            }
                        }

                        //            当前页码
                        var pageNum = data.pageNum;
//            每页的数量
                        var pageSize = data.pageSize;
//            当前页的数量
                        var size = data.size;
//            数据总数
                        var total = data.total;
//            一共多少页
                        var pages = data.pages;
//            首页是多少
                        var firstPage = data.firstPage;
//            上一页是多少
                        var prePage = data.prePage;
//            下一页是多少
                        var nextPage = data.nextPage;
//            最后一页是多少
                        var lastPage = data.lastPage;
//            是否是首页
                        var isFirstPage = data.isFirstPage;
//            是否是尾页
                        var isLastPage = data.isLastPage;
                        if (isFirstPage) {
                            prePage = prePage + 1;
                        }
                        if (isLastPage) {
                            nextPage = lastPage;
                        }
                        $("#pages").html("");
                        $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + prePage + ")'>" + "<<<" + "</a>"));
                        for (i = 1; i <= lastPage; i++) {
                            $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + i + ")'>" + i + "</a>"))
                        }
                        $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + nextPage + ")'>" + ">>>" + "</a>"));
                        $("#pages a").siblings('a').removeClass('selected');
                        $("#pages a").eq(pageNum).addClass('current_page');
                    }
                });
            }

        } else if (btnObj.className == "sort_asc") {
            btnObj.className = "sort_desc";
            var ip = 1;
            $.ajax({
                url: "/costbaseDesc",
                data: {
                    pagenum: ip
                },
                type: "post",
                success: function (data) {
                    console.log(data);
                    $("#datalist").html("");
                    $("#datalist").append("<tr><th>资费ID</th><th class='width100'>资费名称</th><th>基本时长</th><th>基本费用</th><th>单位费用</th><th>创建时间</th><th>开通时间</th><th class='width50'>状态</th><th class='width200'></th></tr>");
                    for (var i in data.list) {
                        var cost = data.list[i];
                        var create = cost.creatime;
                        var open = cost.startime;
                        var createdate = getLocalTime(create);
                        var startdate = getLocalTime(open);
                        var status = cost.status;
                        var ss = cost.status;
                        var costId = cost.costId;
                        var s = null;
                        if (status == 0) {
                            status = "开通";
                            s = "暂停";
                            $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_pause' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                        }
                        if (status == 1) {
                            status = "暂停";
                            s = "启用";
                            $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_start' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                        }
                        if (status == 2) {
                            status = "删除";
                            s = " ";
                            $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' onclick=\"setState('" + costId + "," + ss + "')\"/></td></tr>"));
                        }

                    }

                    //            当前页码
                    var pageNum = data.pageNum;
//            每页的数量
                    var pageSize = data.pageSize;
//            当前页的数量
                    var size = data.size;
//            数据总数
                    var total = data.total;
//            一共多少页
                    var pages = data.pages;
//            首页是多少
                    var firstPage = data.firstPage;
//            上一页是多少
                    var prePage = data.prePage;
//            下一页是多少
                    var nextPage = data.nextPage;
//            最后一页是多少
                    var lastPage = data.lastPage;
//            是否是首页
                    var isFirstPage = data.isFirstPage;
//            是否是尾页
                    var isLastPage = data.isLastPage;
                    if (isFirstPage) {
                        prePage = prePage + 1;
                    }
                    if (isLastPage) {
                        nextPage = lastPage;
                    }
                    $("#pages").html("");
                    $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + prePage + ")'>" + "<<<" + "</a>"));
                    for (i = 1; i <= lastPage; i++) {
                        $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + i + ")'>" + i + "</a>"))
                    }
                    $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + nextPage + ")'>" + ">>>" + "</a>"));
                    var urlstatus = false;
                    if (!urlstatus) {
                        $("#pages a").eq(1).addClass('current_page');
                    }
                }
            });
            function page(i) {
                ip = i;
                $.ajax({
                    url: "/costbaseDesc",
                    data: {
                        pagenum: ip
                    },
                    type: "post",
                    success: function (data) {
                        console.log(data);
                        $("#datalist").html("");
                        $("#datalist").append("<tr><th>资费ID</th><th class='width100'>资费名称</th><th>基本时长</th><th>基本费用</th><th>单位费用</th><th>创建时间</th><th>开通时间</th><th class='width50'>状态</th><th class='width200'></th></tr>");
                        for (var i in data.list) {
                            var cost = data.list[i];
                            var create = cost.creatime;
                            var open = cost.startime;
                            var createdate = getLocalTime(create);
                            var startdate = getLocalTime(open);
                            var status = cost.status;
                            var ss = cost.status;
                            var costId = cost.costId;
                            var s = null;
                            if (status == 0) {
                                status = "开通";
                                s = "暂停";
                                $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_pause' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                            }
                            if (status == 1) {
                                status = "暂停";
                                s = "启用";
                                $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_start' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                            }
                            if (status == 2) {
                                status = "删除";
                                s = " ";
                                $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' onclick=\"setState('" + costId + "," + ss + "')\"/></td></tr>"));
                            }

                        }

                        //            当前页码
                        var pageNum = data.pageNum;
//            每页的数量
                        var pageSize = data.pageSize;
//            当前页的数量
                        var size = data.size;
//            数据总数
                        var total = data.total;
//            一共多少页
                        var pages = data.pages;
//            首页是多少
                        var firstPage = data.firstPage;
//            上一页是多少
                        var prePage = data.prePage;
//            下一页是多少
                        var nextPage = data.nextPage;
//            最后一页是多少
                        var lastPage = data.lastPage;
//            是否是首页
                        var isFirstPage = data.isFirstPage;
//            是否是尾页
                        var isLastPage = data.isLastPage;
                        if (isFirstPage) {
                            prePage = prePage + 1;
                        }
                        if (isLastPage) {
                            nextPage = lastPage;
                        }
                        $("#pages").html("");
                        $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + prePage + ")'>" + "<<<" + "</a>"));
                        for (i = 1; i <= lastPage; i++) {
                            $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + i + ")'>" + i + "</a>"))
                        }
                        $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + nextPage + ")'>" + ">>>" + "</a>"));
                        $("#pages a").siblings('a').removeClass('selected');
                        $("#pages a").eq(pageNum).addClass('current_page');
                    }
                });
            }
        }
    }
    //排序按钮的点击事件
    function sorttime(btnObj) {
        if (btnObj.className == "sort_desc") {
            btnObj.className = "sort_asc";
            var ip = 1;
            $.ajax({
                url: "/costtiemAsc",
                data: {
                    pagenum: ip
                },
                type: "post",
                success: function (data) {
                    console.log(data);
                    $("#datalist").html("");
                    $("#datalist").append("<tr><th>资费ID</th><th class='width100'>资费名称</th><th>基本时长</th><th>基本费用</th><th>单位费用</th><th>创建时间</th><th>开通时间</th><th class='width50'>状态</th><th class='width200'></th></tr>");
                    for (var i in data.list) {
                        var cost = data.list[i];
                        var create = cost.creatime;
                        var open = cost.startime;
                        var createdate = getLocalTime(create);
                        var startdate = getLocalTime(open);
                        var status = cost.status;
                        var ss = cost.status;
                        var costId = cost.costId;
                        var s = null;
                        if (status == 0) {
                            status = "开通";
                            s = "暂停";
                            $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_pause' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                        }
                        if (status == 1) {
                            status = "暂停";
                            s = "启用";
                            $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_start' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                        }
                        if (status == 2) {
                            status = "删除";
                            s = " ";
                            $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' onclick=\"setState('" + costId + "," + ss + "')\"/></td></tr>"));
                        }

                    }

                    //            当前页码
                    var pageNum = data.pageNum;
//            每页的数量
                    var pageSize = data.pageSize;
//            当前页的数量
                    var size = data.size;
//            数据总数
                    var total = data.total;
//            一共多少页
                    var pages = data.pages;
//            首页是多少
                    var firstPage = data.firstPage;
//            上一页是多少
                    var prePage = data.prePage;
//            下一页是多少
                    var nextPage = data.nextPage;
//            最后一页是多少
                    var lastPage = data.lastPage;
//            是否是首页
                    var isFirstPage = data.isFirstPage;
//            是否是尾页
                    var isLastPage = data.isLastPage;
                    if (isFirstPage) {
                        prePage = prePage + 1;
                    }
                    if (isLastPage) {
                        nextPage = lastPage;
                    }
                    $("#pages").html("");
                    $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + prePage + ")'>" + "<<<" + "</a>"));
                    for (i = 1; i <= lastPage; i++) {
                        $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + i + ")'>" + i + "</a>"))
                    }
                    $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + nextPage + ")'>" + ">>>" + "</a>"));
                    var urlstatus = false;
                    if (!urlstatus) {
                        $("#pages a").eq(1).addClass('current_page');
                    }
                }
            });
            function page(i) {
                ip = i;
                $.ajax({
                    url: "/costtiemDesc",
                    data: {
                        pagenum: ip
                    },
                    type: "post",
                    success: function (data) {
                        console.log(data);
                        $("#datalist").html("");
                        $("#datalist").append("<tr><th>资费ID</th><th class='width100'>资费名称</th><th>基本时长</th><th>基本费用</th><th>单位费用</th><th>创建时间</th><th>开通时间</th><th class='width50'>状态</th><th class='width200'></th></tr>");
                        for (var i in data.list) {
                            var cost = data.list[i];
                            var create = cost.creatime;
                            var open = cost.startime;
                            var createdate = getLocalTime(create);
                            var startdate = getLocalTime(open);
                            var status = cost.status;
                            var ss = cost.status;
                            var costId = cost.costId;
                            var s = null;
                            if (status == 0) {
                                status = "开通";
                                s = "暂停";
                                $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_pause' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                            }
                            if (status == 1) {
                                status = "暂停";
                                s = "启用";
                                $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_start' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                            }
                            if (status == 2) {
                                status = "删除";
                                s = " ";
                                $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' onclick=\"setState('" + costId + "," + ss + "')\"/></td></tr>"));
                            }

                        }

                        //            当前页码
                        var pageNum = data.pageNum;
//            每页的数量
                        var pageSize = data.pageSize;
//            当前页的数量
                        var size = data.size;
//            数据总数
                        var total = data.total;
//            一共多少页
                        var pages = data.pages;
//            首页是多少
                        var firstPage = data.firstPage;
//            上一页是多少
                        var prePage = data.prePage;
//            下一页是多少
                        var nextPage = data.nextPage;
//            最后一页是多少
                        var lastPage = data.lastPage;
//            是否是首页
                        var isFirstPage = data.isFirstPage;
//            是否是尾页
                        var isLastPage = data.isLastPage;
                        if (isFirstPage) {
                            prePage = prePage + 1;
                        }
                        if (isLastPage) {
                            nextPage = lastPage;
                        }
                        $("#pages").html("");
                        $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + prePage + ")'>" + "<<<" + "</a>"));
                        for (i = 1; i <= lastPage; i++) {
                            $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + i + ")'>" + i + "</a>"))
                        }
                        $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + nextPage + ")'>" + ">>>" + "</a>"));
                        $("#pages a").siblings('a').removeClass('selected');
                        $("#pages a").eq(pageNum).addClass('current_page');
                    }
                });
            }

        } else if (btnObj.className == "sort_asc") {
            btnObj.className = "sort_desc";
            var ip = 1;
            $.ajax({
                url: "/listfee",
                data: {
                    pagenum: ip
                },
                type: "post",
                success: function (data) {
                    console.log(data);
                    $("#datalist").html("");
                    $("#datalist").append("<tr><th>资费ID</th><th class='width100'>资费名称</th><th>基本时长</th><th>基本费用</th><th>单位费用</th><th>创建时间</th><th>开通时间</th><th class='width50'>状态</th><th class='width200'></th></tr>");
                    for (var i in data.list) {
                        var cost = data.list[i];
                        var create = cost.creatime;
                        var open = cost.startime;
                        var createdate = getLocalTime(create);
                        var startdate = getLocalTime(open);
                        var status = cost.status;
                        var ss = cost.status;
                        var costId = cost.costId;
                        var s = null;
                        if (status == 0) {
                            status = "开通";
                            s = "暂停";
                            $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_pause' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                        }
                        if (status == 1) {
                            status = "暂停";
                            s = "启用";
                            $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_start' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                        }
                        if (status == 2) {
                            status = "删除";
                            s = " ";
                            $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' onclick=\"setState('" + costId + "," + ss + "')\"/></td></tr>"));
                        }

                    }

                    //            当前页码
                    var pageNum = data.pageNum;
//            每页的数量
                    var pageSize = data.pageSize;
//            当前页的数量
                    var size = data.size;
//            数据总数
                    var total = data.total;
//            一共多少页
                    var pages = data.pages;
//            首页是多少
                    var firstPage = data.firstPage;
//            上一页是多少
                    var prePage = data.prePage;
//            下一页是多少
                    var nextPage = data.nextPage;
//            最后一页是多少
                    var lastPage = data.lastPage;
//            是否是首页
                    var isFirstPage = data.isFirstPage;
//            是否是尾页
                    var isLastPage = data.isLastPage;
                    if (isFirstPage) {
                        prePage = prePage + 1;
                    }
                    if (isLastPage) {
                        nextPage = lastPage;
                    }
                    $("#pages").html("");
                    $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + prePage + ")'>" + "<<<" + "</a>"));
                    for (i = 1; i <= lastPage; i++) {
                        $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + i + ")'>" + i + "</a>"))
                    }
                    $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + nextPage + ")'>" + ">>>" + "</a>"));
                    var urlstatus = false;
                    if (!urlstatus) {
                        $("#pages a").eq(1).addClass('current_page');
                    }
                }
            });
            function page(i) {
                ip = i;
                $.ajax({
                    url: "/listfee",
                    data: {
                        pagenum: ip
                    },
                    type: "post",
                    success: function (data) {
                        console.log(data);
                        $("#datalist").html("");
                        $("#datalist").append("<tr><th>资费ID</th><th class='width100'>资费名称</th><th>基本时长</th><th>基本费用</th><th>单位费用</th><th>创建时间</th><th>开通时间</th><th class='width50'>状态</th><th class='width200'></th></tr>");
                        for (var i in data.list) {
                            var cost = data.list[i];
                            var create = cost.creatime;
                            var open = cost.startime;
                            var createdate = getLocalTime(create);
                            var startdate = getLocalTime(open);
                            var status = cost.status;
                            var ss = cost.status;
                            var costId = cost.costId;
                            var s = null;
                            if (status == 0) {
                                status = "开通";
                                s = "暂停";
                                $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_pause' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                            }
                            if (status == 1) {
                                status = "暂停";
                                s = "启用";
                                $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' class='btn_start' onclick=\"setState('" + costId + "," + ss + "')\"/><input type='button' value='修改' class='btn_modify' onclick='updateFee(" + cost.costId + ");'';'/><input type='button' value='删除' class='btn_delete' onclick='deleteFee(" + cost.costId + ");'/></td></tr>"));
                            }
                            if (status == 2) {
                                status = "删除";
                                s = " ";
                                $("#datalist").append($("<tr><td>" + cost.costId + "</td><td><a href='/detail?'>" + cost.name + "</a></td><td>" + cost.baseDuration + "小时" + "</td><td>" + cost.baseCost + "元" + "</td><td>" + cost.unitCost + "元/小时" + "</td><td>" + createdate + "</td><td>" + startdate + "</td><td>" + status + "</td><td><input type='button' value='" + s + "' onclick=\"setState('" + costId + "," + ss + "')\"/></td></tr>"));
                            }

                        }

                        //            当前页码
                        var pageNum = data.pageNum;
//            每页的数量
                        var pageSize = data.pageSize;
//            当前页的数量
                        var size = data.size;
//            数据总数
                        var total = data.total;
//            一共多少页
                        var pages = data.pages;
//            首页是多少
                        var firstPage = data.firstPage;
//            上一页是多少
                        var prePage = data.prePage;
//            下一页是多少
                        var nextPage = data.nextPage;
//            最后一页是多少
                        var lastPage = data.lastPage;
//            是否是首页
                        var isFirstPage = data.isFirstPage;
//            是否是尾页
                        var isLastPage = data.isLastPage;
                        if (isFirstPage) {
                            prePage = prePage + 1;
                        }
                        if (isLastPage) {
                            nextPage = lastPage;
                        }
                        $("#pages").html("");
                        $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + prePage + ")'>" + "<<<" + "</a>"));
                        for (i = 1; i <= lastPage; i++) {
                            $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + i + ")'>" + i + "</a>"))
                        }
                        $("#pages").append($("<a href='javascript:void(0)' onclick='page(" + nextPage + ")'>" + ">>>" + "</a>"));
                        $("#pages a").siblings('a').removeClass('selected');
                        $("#pages a").eq(pageNum).addClass('current_page');
                    }
                });
            }
        }
    }
</script>
<div id="footer">
    <p>[源自北美的技术，最优秀的师资，最真实的企业环境，最适用的实战项目]</p>
    <p>版权所有(C)云科技有限公司</p>
</div>
</body>
</html>
